library(kknn)

setwd("D:/ClassificationR")

#membaca data training & data testing
data.training = read.csv("iris2class.train.1.csv")
data.test = read.csv("iris2class.test.1.csv")

#membuat model & melakukan prediksi 
model = kknn(Species~., data.training, data.test[,-5], k = 5, distance = 1, kernel = "triangular")

comparation_result = cbind(prediction = as.character(model$fitted.values), actual = as.character(data.test[,5]))
comparation_result
